This invention relates to a data conversion apparatus and a data conversion method, and more particularly to a data conversion apparatus and a data conversion method which compresses data, writes the compressed data into a memory, reads out the data from the memory and decompresses the read out data.
Two formats for representing a real number in a binary number of a fixed finite length are available including a fixed-point format and a floating-point format. The fixed-point format represents a real number with the decimal point fixed to a particular position and usually has a configuration including a sign bit added to a part which represents a numerical value. Meanwhile, the floating-point format represents a certain number y in a combination of an r-ary fixed-point number f (mantissa part) and an r-ary integer e (characteristic or exponent part) wherein r is an integer and makes a base. In this instance, the number y is a result of multiplication of the mantissa part f by r to the eth power, that is, y=fxc3x97re. Usually, r=2 is used as the base, and a sign bit is added to the number y.
Since the fixed-point format has the characteristic that the decimal point position is fixed, it is narrow in dynamic range and is limited in the range within which it can represent real numbers. Therefore, when to actually prepare a program, a technique is utilized that a numerical value portion of the fixed-point format is regarded as the mantissa part and the exponent part is held in another variable to suitably change the decimal point position. In this instance, however, it is necessary to grasp the dynamic range of arithmetic operation to set the exponent part so that an overflow or an underflow may not occur.
In contrast, the floating-point format allows arithmetic operation to be performed while the finite precision of the mantissa part is maintained and achieves a wide dynamic range through variation of the exponent part. Therefore, the dynamic range may be grasped roughly, and a program can be developed efficiently. Particularly a processing apparatus which has a floating-point arithmetic unit can perform numerical arithmetic operation of the floating-point format at a high speed.
However, the floating-point format requires a greater number of bits than the fixed-point format because the mantissa part is included in data. For example, while a format used popularly as the fixed-point format handles 16-bit data including a numerical value portion of 15 bits, data of the single precision floating-point format according to the IEEE (Institute of Electrical and Electronics Engineers) standards (IEEE standards 754-1985) are 32-bit data including the mantissa part of 23 bits. The problem of the data capacity is particularly serious where a large number data of the floating-point format are prepared in a table and used for arithmetic operation.
In order to implement a sampling rate converter, for example, from 41 KHz to 32 KHz, a FIR (Finite-duration Impulse Response) filter having 512 to 1024 taps (coefficients) must be constructed, and in order to hold the coefficients in a table, it is required to make the data compact to the utmost.
It is an object of the present invention to provide a data conversion apparatus and a data conversion method by which, when data of a format used in a processing apparatus is to be written into a memory, it can be written in a compressed form and, when the data is to be read out from the memory, it can be read out in a decompressed form.
In order to attain the object described above, according to an aspect of the present invention is provided a data conversion apparatus, including approximation means operable when a writing instruction for writing first data having a first format into a memory is received from a processing apparatus for approximating the first data with a predetermined portion of a write address directed by the writing instruction and second data having a second format, and conversion data writing means for writing the second data specified by the approximation means in place of the first data into the memory. With the data conversion apparatus, the data having the first format is approximated with the predetermined portion of the write address corresponding to the writing instruction received from the processing apparatus and the second data having the second format.
According to another aspect of the present invention, there is provided a data conversion apparatus, including approximation means operable when a reading instruction for reading out first data having a first format from a memory is received from a processing apparatus for approximating the first data with a predetermined portion of a read address directed by the reading instruction and second data having a second format, and conversion data reading means for reading out the second data specified by the approximation means in place of the first data from the memory. With the data conversion apparatus, the data having the first format is approximated with the predetermined portion of the read address corresponding to the reading instruction received from the processing apparatus and the second data having the second format.
According to a further aspect of the present invention, there is provided a data conversion apparatus which converts, in response to a writing instruction outputted from a processing apparatus for writing data of a first format into a memory, the data of the first format into data of a second format, including means for generating a signal according to a predetermined portion of a write address directed by the writing instruction outputted from the processing apparatus and a first predetermined portion of the data of the first format, and means for performing a predetermined operation for a second predetermined portion of the data of the first format in accordance with said signal to obtain a predetermined portion of the data of the second format. With the data conversion apparatus, the data of the first format is approximated with the predetermined portion of the write address corresponding to the writing instruction outputted from the processing apparatus and the data having the second format.
According to a still further aspect of the present invention, there is provided a data conversion apparatus which converts, in response to a reading instruction outputted from a processing apparatus for reading out data of a first format from a memory, data of a second format outputted from the memory into data of the first format which includes a first predetermined portion and a second predetermined portion, including means for repetitively performing a predetermined operation for a predetermined portion of the data of the second format until a predetermined condition is satisfied to obtain the second predetermined portion of data of the first format, and means for determining the first predetermined portion of the data of the first format based on a predetermined portion of a read address directed by the reading instruction outputted from the processing apparatus and the number of times by which the predetermined operation is performed. With the data conversion apparatus, the data of the first format is approximated with the predetermined portion of the read address corresponding to the reading instruction outputted from the processing apparatus and the data having the second format.
According to a yet further aspect of the present invention, there is provided a data conversion method for converting, in response to a writing instruction outputted from a processing apparatus for writing data of a first format into a memory, the data of the first format into data of a second format, including the steps of generating a signal according to a predetermined portion of a write address directed by the writing instruction outputted from the processing apparatus and a first predetermined portion of the data of the first format, and performing a predetermined operation for a second predetermined portion of the data of the first format in accordance with said signal to obtain a predetermined portion of the data of the second format. With the data conversion method, the data of the first format is approximated with the predetermined portion of the write address corresponding to the writing instruction outputted from the processing apparatus and the data having the second format.
With the data conversion apparatus and the data conversion method of the present invention described above, when data of the format used in the processing apparatus is to be written into the memory, it can be written in a compressed form. Then, when the data is to be read out from the memory, it can be read out in a decompressed form. Consequently, the used amount of the memory, that is, the capacity of the memory, can be reduced without restricting processing of the processing apparatus.
The above and other objects, features and advantages of the present invention will become apparent from the following description and the appended claims, taken in conjunction with the accompanying drawings in which like parts or elements denoted by like reference symbols.